﻿using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace Tool.Services
{
    public class UidService : IScopedDependency
    {
        private readonly IHttpClientFactory httpClientFactory;

        public UidService(IHttpClientFactory httpClientFactory)
        {
            this.httpClientFactory = httpClientFactory;
        }

        public async Task<string> GetUid()
        {
            using (var httpClient = httpClientFactory.CreateClient("uid"))
            {
               var result = await httpClient.GetStringAsync("/gwhome-identity-service/get_uid");
                return result;
            }
        }
    }
}
